/**
 * 
 */
package com.mbengue.corp.apr.ra.core;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
 * @author MMB11447
 *
 */
@Entity
@Table
public class Image implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id	
	@Column(nullable=false, unique=true, length=64)
	private String nom;

	@Lob
	@Column(nullable=false)
	private byte[] image;
	
	@Column(nullable=true, unique=false, length=128)
	private String description;

	/**
	 * @return the nom
	 */
	public String getNom() {
		return nom;
	}

	/**
	 * @param nom the nom to set
	 */
	public void setNom(String nom) {
		this.nom = nom;
	}

	/**
	 * @return the path
	 */
	public byte[] getImage() {
		return image;
	}

	/**
	 * @param path the path to set
	 */
	public void setImage(byte[] image) {
		this.image = image.clone();
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	public Image(String nom, byte[] image, String description) {
		super();
		this.nom = nom;
		this.image = image.clone();
		this.description = description;
	}
	
	public Image() {
	}

}
